package com.dongdong.controller;

import com.dongdong.result.Result;
import com.dongdong.service.TbItemCatService;
import com.dongdong.vo.TbItemCatVO;
import com.dongdong.vo.TypeTemplateVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/itemCat")
public class TbItemCatController {

    @Autowired
    private TbItemCatService itemCatService;

    @GetMapping("/getItemCat")
    public Result getItemCat(@RequestParam Long pid){
        List<TbItemCatVO> itemCatvos = itemCatService.getItemCat(pid);
        return Result.OK().setData(itemCatvos);

    }

    @GetMapping("/getTypetemplate")
    public Result getTypetemplate(@RequestParam Long id){
        TypeTemplateVO tbItemCatVO=itemCatService.getTypetemplate(id);
        return Result.OK().setData(tbItemCatVO);

    }











}